//
//  MXHomePageController.m
//  MXUserSys
//
//  Created by 王启颖 on 2018/10/10.
//  Copyright © 2018年 王启颖. All rights reserved.
//

#import "MXHomePageController.h"
#import "MXCreateBeltController.h"
#import "MXHomePageTableView.h"

@interface MXHomePageController ()
@property(strong,nonatomic)MXHomePageTableView *tableview;
@end

@implementation MXHomePageController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.title = @"首页";
    
    [self barButtonItemName:nil withImageName:@"AddFocus" targer:@"addBeltClick" isRight:YES];
}

-(void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    [self tableview];
    [self.tableview refresh];
}

-(void)addBeltClick{
    MXCreateBeltController *createBeltVC = [[MXCreateBeltController alloc]init];
    [self.navigationController pushViewController:createBeltVC animated:YES];
}

#pragma mark - 懒加载 -
-(MXHomePageTableView *)tableview{
    if (!_tableview) {
        
        MXHomePageTableView *view = [[MXHomePageTableView alloc]initWithFrame:self.view.bounds];
        _tableview = view;
        _tableview.navigationController = self.navigationController;
        [self.view addSubview:_tableview];
    }
    return _tableview;
}









@end
